/*
 * Window.h
 *
 *  Created on: Jan 18, 2013
 *      Author: quanpv
 */

#ifndef WINDOW_H_
#define WINDOW_H_

#include <boost/shared_ptr.hpp>

class Window {
public:
	Window();
	Window(boost::shared_ptr<View> contents);
	virtual ~Window();

	// requests handled by window
	virtual void DrawContents();
	virtual void Open();
	virtual void Close();
	virtual void Iconify();
	virtual void Deiconify();

	// requests forwarded to implementation
	virtual void SetOrigin(const Point& at);
	virtual void SetExtent(const Point& extent);
	virtual void Raise();
	virtual void Lower();

	virtual void DrawLine(const Point&, const Point&);
	virtual void DrawRect(const Point&, const Point&);
	virtual void DrawPolygon(const Point[], int n);
	virtual void DrawText(const char*, const Point&);

protected:
	boost::shared_ptr<WindowImp> GetWindowImp();
	boost::shared_ptr<View> GetView();

private:
	boost::shared_ptr<WindowImp> _imp;
	boost::shared_ptr<View> _contents; // the window's contents

};

#endif /* WINDOW_H_ */
